package ar.edu.unq.wannaplay.panels.employee;

import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;

import ar.edu.unq.wannaplay.panels.WPListViewPanel;
import ar.edu.unq.wannaplay.roles.AbstractLinkAdderStrategy;
import ar.edu.unq.wannaplay.services.EmployeeService;
import ar.edu.unq.wannaplay.utils.EmployeeListView;

public class EmployeesViewPanel extends WPListViewPanel<EmployeeService> {

    private static final long serialVersionUID = 1L;

    public EmployeesViewPanel(final String id, final EmployeeService service) {
        super(id, service, new String[] { "name", "surname", "dni", "telephone", "email" });
        this.initialize();
    }

    private void initialize() {
        AbstractLinkAdderStrategy.getUserLoged().addEmployeeCreateLink(this);
        this.add(this.prepareHeaderLabel("headers"));
        EmployeeListView listView = new EmployeeListView("populatedList", this.getService(), this.getLabels(), this);
        this.add(listView);
        this.add(new PagingNavigator("navigator", listView));
    }
}
